<html>
<head><meta charset="utf-8"><title>incorrect completion with self + references · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html">incorrect completion with self + references</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232118969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/incorrect%20completion%20with%20self%20%2B%20references/near/232118969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html#232118969">(Mar 27 2021 at 21:17)</a>:</h4>
<p>Hello! RA nicely reccomends <code>&amp;foo</code> over <code> foo</code> if a parameter to a func expects a reference, but sadly it kind of breaks when you use <code>self.foo</code> and it resolves to <code>self.&amp;foo</code> which is less than ideal. I wanted to know if this is a known bug before i submit a possibly duplicate issue <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="232119036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/incorrect%20completion%20with%20self%20%2B%20references/near/232119036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html#232119036">(Mar 27 2021 at 21:18)</a>:</h4>
<p>Yep thats already known and afaik being worked on <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="232119050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/incorrect%20completion%20with%20self%20%2B%20references/near/232119050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html#232119050">(Mar 27 2021 at 21:18)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/issues/8058">https://github.com/rust-analyzer/rust-analyzer/issues/8058</a></p>



<a name="232120631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/incorrect%20completion%20with%20self%20%2B%20references/near/232120631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html#232120631">(Mar 27 2021 at 21:49)</a>:</h4>
<p>thanks <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="232124675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/incorrect%20completion%20with%20self%20%2B%20references/near/232124675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Mcguigan <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/incorrect.20completion.20with.20self.20.2B.20references.html#232124675">(Mar 27 2021 at 23:05)</a>:</h4>
<p>And a temporary “fix” has been implemented in <a href="https://github.com/rust-analyzer/rust-analyzer/pull/8142">https://github.com/rust-analyzer/rust-analyzer/pull/8142</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>